
ccflags=-g -Wall -Wno-deprecated


all: sabc dumpKlass

sabc: main.o Assembler.o ClassFile.o ClassFileConstant.o SimpleIo.o ConstantPool.o FieldInfo.o MethodInfo.o AttributeInfo.o grammar.o scanner.o AstNode.o SymbolPool.o AstNodeForStatement.o
	g++ -o sabc main.o Assembler.o ClassFile.o ClassFileConstant.o SimpleIo.o ConstantPool.o FieldInfo.o MethodInfo.o \
	AttributeInfo.o grammar.o scanner.o AstNode.o SymbolPool.o \
	AstNodeForStatement.o $(ldflags) 

dumpKlass: dumpKlass.o Assembler.o ClassFile.o ClassFileConstant.o SimpleIo.o ConstantPool.o FieldInfo.o MethodInfo.o AttributeInfo.o
	g++ -o dumpKlass dumpKlass.o Assembler.o ClassFile.o ClassFileConstant.o SimpleIo.o ConstantPool.o FieldInfo.o MethodInfo.o AttributeInfo.o $(ldflags)

main.o: main.cc Assembler.h
	gcc -c main.cc $(ccflags)


######################### grammar stuff
grammar.cc: grammar.y
	bison -o grammar.cc grammar.y -d

grammar.o: grammar.cc
	gcc -c grammar.cc $(ccflags)

scanner.cc: scanner.l
	flex -o scanner.cc scanner.l 

scanner.o: scanner.cc
	gcc -c scanner.cc $(ccflags)

AstNode.o: AstNode.cc
	gcc -c AstNode.cc $(ccflags)

AstNodeForStatement.o: AstNodeForStatement.cc
	gcc -c AstNodeForStatement.cc $(ccflags)

######################### grammar stuff end

ClassFile.o: ClassFile.cc ClassFile.h
	gcc -c ClassFile.cc $(ccflags)

Assembler.o: Assembler.cc Assembler.h
	gcc -c Assembler.cc  $(ccflags)

ClassFileConstant.o: ClassFileConstant.cc ClassFileConstant.h
	gcc -c ClassFileConstant.cc $(ccflags)

SimpleIo.o: SimpleIo.cc SimpleIo.h
	gcc -c SimpleIo.cc $(ccflags)

ConstantPool.o: ConstantPool.cc ConstantPool.h
	gcc -c ConstantPool.cc $(ccflags)

FieldInfo.o: FieldInfo.cc FieldInfo.h
	gcc -c FieldInfo.cc $(ccflags)

MethodInfo.o: MethodInfo.cc MethodInfo.h
	gcc -c MethodInfo.cc $(ccflags)

AttributeInfo.o: AttributeInfo.cc AttributeInfo.h
	gcc -c AttributeInfo.cc $(ccflags)

SymbolPool.o: SymbolPool.cc
	gcc -c SymbolPool.cc  $(ccflags)

test-all: main
	./test-all.sh

depend:
	makedepend *.cc grammar.y scanner.l


clean:
	rm -f *.o
	rm -f sabc
	rm -f dumpKlass
	rm -f grammar.cc scanner.cc grammar.hh
	rm -f test-all.result

.PHONY: depend clean
# DO NOT DELETE

Assembler.o: /usr/include/strings.h /usr/include/features.h
Assembler.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
Assembler.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h
Assembler.o: /usr/include/xlocale.h /usr/include/stdio.h
Assembler.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
Assembler.o: /usr/include/libio.h /usr/include/_G_config.h
Assembler.o: /usr/include/wchar.h /usr/include/bits/stdio_lim.h
Assembler.o: /usr/include/bits/sys_errlist.h /usr/include/stdlib.h
Assembler.o: /usr/include/sys/types.h /usr/include/time.h
Assembler.o: /usr/include/endian.h /usr/include/bits/endian.h
Assembler.o: /usr/include/bits/byteswap.h /usr/include/sys/select.h
Assembler.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
Assembler.o: /usr/include/bits/time.h /usr/include/sys/sysmacros.h
Assembler.o: /usr/include/bits/pthreadtypes.h /usr/include/alloca.h
Assembler.o: /usr/include/assert.h Assembler.h jtypes.h SimpleIo.h
Assembler.o: ConstantPool.h ClassFileConstant.h
AstNode.o: /usr/include/ctype.h /usr/include/features.h
AstNode.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
AstNode.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h
AstNode.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
AstNode.o: /usr/include/endian.h /usr/include/bits/endian.h
AstNode.o: /usr/include/bits/byteswap.h /usr/include/xlocale.h
AstNode.o: /usr/include/assert.h AstNode.h jtypes.h /usr/include/stdio.h
AstNode.o: /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h
AstNode.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
AstNode.o: MethodInfo.h AttributeInfo.h SimpleIo.h Assembler.h ConstantPool.h
AstNode.o: ClassFileConstant.h ClassFile.h
AstNodeForStatement.o: AstNodeForStatement.h AstNode.h jtypes.h
AstNodeForStatement.o: /usr/include/stdio.h /usr/include/features.h
AstNodeForStatement.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
AstNodeForStatement.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h
AstNodeForStatement.o: /usr/include/bits/types.h
AstNodeForStatement.o: /usr/include/bits/typesizes.h /usr/include/libio.h
AstNodeForStatement.o: /usr/include/_G_config.h /usr/include/wchar.h
AstNodeForStatement.o: /usr/include/bits/stdio_lim.h
AstNodeForStatement.o: /usr/include/bits/sys_errlist.h MethodInfo.h
AstNodeForStatement.o: AttributeInfo.h SimpleIo.h Assembler.h
AttributeInfo.o: /usr/include/assert.h /usr/include/features.h
AttributeInfo.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
AttributeInfo.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h
AttributeInfo.o: /usr/include/string.h /usr/include/xlocale.h jtypes.h
AttributeInfo.o: /usr/include/stdio.h /usr/include/bits/types.h
AttributeInfo.o: /usr/include/bits/typesizes.h /usr/include/libio.h
AttributeInfo.o: /usr/include/_G_config.h /usr/include/wchar.h
AttributeInfo.o: /usr/include/bits/stdio_lim.h
AttributeInfo.o: /usr/include/bits/sys_errlist.h AttributeInfo.h SimpleIo.h
AttributeInfo.o: Assembler.h ConstantPool.h ClassFileConstant.h Log.h
ClassFile.o: /usr/include/assert.h /usr/include/features.h
ClassFile.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
ClassFile.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h
ClassFile.o: /usr/include/stdio.h /usr/include/bits/types.h
ClassFile.o: /usr/include/bits/typesizes.h /usr/include/libio.h
ClassFile.o: /usr/include/_G_config.h /usr/include/wchar.h
ClassFile.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
ClassFile.o: /usr/include/stdlib.h /usr/include/sys/types.h
ClassFile.o: /usr/include/time.h /usr/include/endian.h
ClassFile.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
ClassFile.o: /usr/include/sys/select.h /usr/include/bits/select.h
ClassFile.o: /usr/include/bits/sigset.h /usr/include/bits/time.h
ClassFile.o: /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h
ClassFile.o: /usr/include/alloca.h /usr/include/string.h
ClassFile.o: /usr/include/xlocale.h ClassFile.h ConstantPool.h jtypes.h
ClassFile.o: ClassFileConstant.h SimpleIo.h FieldInfo.h MethodInfo.h
ClassFile.o: AttributeInfo.h Assembler.h Log.h
ClassFileConstant.o: /usr/include/string.h /usr/include/features.h
ClassFileConstant.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
ClassFileConstant.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h
ClassFileConstant.o: /usr/include/xlocale.h /usr/include/assert.h
ClassFileConstant.o: ClassFileConstant.h jtypes.h /usr/include/stdio.h
ClassFileConstant.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
ClassFileConstant.o: /usr/include/libio.h /usr/include/_G_config.h
ClassFileConstant.o: /usr/include/wchar.h /usr/include/bits/stdio_lim.h
ClassFileConstant.o: /usr/include/bits/sys_errlist.h SimpleIo.h
ClassFileConstant.o: ConstantPool.h
ConstantPool.o: /usr/include/assert.h /usr/include/features.h
ConstantPool.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
ConstantPool.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h
ConstantPool.o: /usr/include/string.h /usr/include/xlocale.h
ConstantPool.o: ClassFileConstant.h jtypes.h /usr/include/stdio.h
ConstantPool.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
ConstantPool.o: /usr/include/libio.h /usr/include/_G_config.h
ConstantPool.o: /usr/include/wchar.h /usr/include/bits/stdio_lim.h
ConstantPool.o: /usr/include/bits/sys_errlist.h ConstantPool.h SimpleIo.h
ConstantPool.o: Log.h
dumpKlass.o: /usr/include/stdio.h /usr/include/features.h
dumpKlass.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
dumpKlass.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h
dumpKlass.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
dumpKlass.o: /usr/include/libio.h /usr/include/_G_config.h
dumpKlass.o: /usr/include/wchar.h /usr/include/bits/stdio_lim.h
dumpKlass.o: /usr/include/bits/sys_errlist.h ClassFile.h ConstantPool.h
dumpKlass.o: jtypes.h ClassFileConstant.h MethodInfo.h AttributeInfo.h
dumpKlass.o: SimpleIo.h Assembler.h
FieldInfo.o: /usr/include/assert.h /usr/include/features.h
FieldInfo.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
FieldInfo.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h SimpleIo.h
FieldInfo.o: /usr/include/stdio.h /usr/include/bits/types.h
FieldInfo.o: /usr/include/bits/typesizes.h /usr/include/libio.h
FieldInfo.o: /usr/include/_G_config.h /usr/include/wchar.h
FieldInfo.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
FieldInfo.o: FieldInfo.h jtypes.h ConstantPool.h ClassFileConstant.h
FieldInfo.o: AttributeInfo.h Assembler.h Log.h
grammar.o: /usr/include/math.h /usr/include/features.h
grammar.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
grammar.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h
grammar.o: /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h
grammar.o: /usr/include/bits/huge_vall.h /usr/include/bits/inf.h
grammar.o: /usr/include/bits/nan.h /usr/include/bits/mathdef.h
grammar.o: /usr/include/bits/mathcalls.h /usr/include/stdio.h
grammar.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
grammar.o: /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h
grammar.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
grammar.o: ConstantPool.h jtypes.h ClassFileConstant.h ClassFile.h
grammar.o: SymbolPool.h /usr/include/assert.h AstNode.h MethodInfo.h
grammar.o: AttributeInfo.h SimpleIo.h Assembler.h AstNodeForStatement.h
main.o: /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h
main.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
main.o: /usr/include/gnu/stubs-32.h /usr/include/bits/types.h
main.o: /usr/include/bits/typesizes.h /usr/include/libio.h
main.o: /usr/include/_G_config.h /usr/include/wchar.h
main.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
main.o: /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h
main.o: /usr/include/endian.h /usr/include/bits/endian.h
main.o: /usr/include/bits/byteswap.h /usr/include/sys/select.h
main.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
main.o: /usr/include/bits/time.h /usr/include/sys/sysmacros.h
main.o: /usr/include/bits/pthreadtypes.h /usr/include/alloca.h
main.o: /usr/include/getopt.h ClassFile.h ConstantPool.h jtypes.h
main.o: ClassFileConstant.h MethodInfo.h AttributeInfo.h SimpleIo.h
main.o: Assembler.h AstNode.h
MethodInfo.o: /usr/include/assert.h /usr/include/features.h
MethodInfo.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
MethodInfo.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h SimpleIo.h
MethodInfo.o: /usr/include/stdio.h /usr/include/bits/types.h
MethodInfo.o: /usr/include/bits/typesizes.h /usr/include/libio.h
MethodInfo.o: /usr/include/_G_config.h /usr/include/wchar.h
MethodInfo.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
MethodInfo.o: MethodInfo.h AttributeInfo.h jtypes.h Assembler.h
MethodInfo.o: ConstantPool.h ClassFileConstant.h Log.h
scanner.o: /usr/include/stdio.h /usr/include/features.h
scanner.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
scanner.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h
scanner.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
scanner.o: /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h
scanner.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
scanner.o: /usr/include/string.h /usr/include/xlocale.h /usr/include/errno.h
scanner.o: /usr/include/bits/errno.h /usr/include/linux/errno.h
scanner.o: /usr/include/asm/errno.h /usr/include/asm-generic/errno.h
scanner.o: /usr/include/asm-generic/errno-base.h /usr/include/stdlib.h
scanner.o: /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h
scanner.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
scanner.o: /usr/include/sys/select.h /usr/include/bits/select.h
scanner.o: /usr/include/bits/sigset.h /usr/include/bits/time.h
scanner.o: /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h
scanner.o: /usr/include/alloca.h grammar.hh /usr/include/unistd.h
scanner.o: /usr/include/bits/posix_opt.h /usr/include/bits/confname.h
scanner.o: /usr/include/getopt.h
SimpleIo.o: SimpleIo.h /usr/include/stdio.h /usr/include/features.h
SimpleIo.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
SimpleIo.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h
SimpleIo.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
SimpleIo.o: /usr/include/libio.h /usr/include/_G_config.h
SimpleIo.o: /usr/include/wchar.h /usr/include/bits/stdio_lim.h
SimpleIo.o: /usr/include/bits/sys_errlist.h
SymbolPool.o: /usr/include/stdlib.h /usr/include/features.h
SymbolPool.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
SymbolPool.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h
SymbolPool.o: /usr/include/sys/types.h /usr/include/bits/types.h
SymbolPool.o: /usr/include/bits/typesizes.h /usr/include/time.h
SymbolPool.o: /usr/include/endian.h /usr/include/bits/endian.h
SymbolPool.o: /usr/include/bits/byteswap.h /usr/include/sys/select.h
SymbolPool.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
SymbolPool.o: /usr/include/bits/time.h /usr/include/sys/sysmacros.h
SymbolPool.o: /usr/include/bits/pthreadtypes.h /usr/include/alloca.h
SymbolPool.o: /usr/include/string.h /usr/include/xlocale.h SymbolPool.h
SymbolPool.o: /usr/include/assert.h jtypes.h /usr/include/stdio.h
SymbolPool.o: /usr/include/libio.h /usr/include/_G_config.h
SymbolPool.o: /usr/include/wchar.h /usr/include/bits/stdio_lim.h
SymbolPool.o: /usr/include/bits/sys_errlist.h
grammar.o: /usr/include/math.h /usr/include/features.h
grammar.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
grammar.o: /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h
grammar.o: /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h
grammar.o: /usr/include/bits/huge_vall.h /usr/include/bits/inf.h
grammar.o: /usr/include/bits/nan.h /usr/include/bits/mathdef.h
grammar.o: /usr/include/bits/mathcalls.h /usr/include/stdio.h
grammar.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
grammar.o: /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h
grammar.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
grammar.o: ConstantPool.h jtypes.h ClassFileConstant.h ClassFile.h
grammar.o: SymbolPool.h /usr/include/assert.h AstNode.h MethodInfo.h
grammar.o: AttributeInfo.h SimpleIo.h Assembler.h AstNodeForStatement.h
scanner.o: grammar.hh
